# -*- coding: utf-8 -*-

#    Stingingnettlepy - A static website generator written in Python
#    Copyright (C) 2013  Jannik Haberbosch
#
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
#	Description:
#		This file contains constants for 'Stingingnettlepy'.


# Importion of modules from the Python Standard Library.
import os
import os.path


# Definition of constants.
# Global preferences/settings
ROOT_DIR = os.getcwd()

TEMPLATES_DIRECTORY = "templates"
MODULES_DIRECTORY = "modules"
WEBSITE_INPUT_DIRECTORY = "in"
WEBSITE_OUTPUT_DIRECTORY = "out"
WEBSITE_LOGS_DIRECTORY = "logs"
GLOBAL_CONFIG_FILE = "global.config"
LOCAL_CONFIG_FILE = "local.config"
WEBSITE_DIRECTORY = os.path.basename( os.getcwd() )
LOG_FILE_SUFFIX = "log.txt"
STINGINGNETTLEPY_CONFIG_FILE = "stingingnettlepy.config"

# This file makes sure that a directory on a web-server has indeed been created by 'Stingingnettlepy'.
GENERATED_WITH_STINGINGNETTLEPY_PROTECTION_FILE = "generated_with_stingingnettlepy.txt"

# 'Stingingnettlepy project website directory' data (LPWD data)
STINGINGNETTLEPY_PROJECT_WEBSITE_DIRECTORY_DATA = {
	"directories": (
		os.path.join( WEBSITE_INPUT_DIRECTORY ),
		os.path.join( WEBSITE_OUTPUT_DIRECTORY ),
		os.path.join( MODULES_DIRECTORY ),
		os.path.join( TEMPLATES_DIRECTORY ),
		os.path.join( WEBSITE_LOGS_DIRECTORY ),
		os.path.join( WEBSITE_INPUT_DIRECTORY, "_css" ),
		os.path.join( WEBSITE_INPUT_DIRECTORY, "_js" ),
		os.path.join( WEBSITE_INPUT_DIRECTORY, "_media" ),
		os.path.join( WEBSITE_INPUT_DIRECTORY, "_media", "photos" ),
		os.path.join( WEBSITE_INPUT_DIRECTORY, "_media", "videos" ),
		os.path.join( WEBSITE_INPUT_DIRECTORY, "_media", "music" ),
		os.path.join( WEBSITE_INPUT_DIRECTORY, "_media", "downloads" )
	),
	"files": (
		os.path.join( WEBSITE_INPUT_DIRECTORY, "_css", "basic.css" ),
		os.path.join( WEBSITE_INPUT_DIRECTORY, "_js", "basic.js" ),
		os.path.join( TEMPLATES_DIRECTORY, "basic.template" ),
		os.path.join( MODULES_DIRECTORY, "__init__.py" ),
		os.path.join( WEBSITE_INPUT_DIRECTORY, GLOBAL_CONFIG_FILE ),
		STINGINGNETTLEPY_CONFIG_FILE	
	)
}

# This list presents demo data for 'Stingingnettlepy'.
STINGINGNETTLEPY_PROJECT_WEBSITE_DIRECTORY_DEMO_DATA = {
	"directories": (
		os.path.join( WEBSITE_INPUT_DIRECTORY ),
		os.path.join( WEBSITE_INPUT_DIRECTORY, "0_home" ),
		os.path.join( WEBSITE_INPUT_DIRECTORY, "1_about" ),
		os.path.join( WEBSITE_INPUT_DIRECTORY, "2_jungle" ),
		os.path.join( WEBSITE_INPUT_DIRECTORY, "3_gallery" ),
		os.path.join( WEBSITE_INPUT_DIRECTORY, "4_links" ),		
		os.path.join( WEBSITE_INPUT_DIRECTORY, "_css" ),
		os.path.join( WEBSITE_INPUT_DIRECTORY, "_js" ),
		os.path.join( WEBSITE_INPUT_DIRECTORY, "_media" ),
		os.path.join( WEBSITE_INPUT_DIRECTORY, "_media", "photos" ),
		os.path.join( WEBSITE_INPUT_DIRECTORY, "_media", "videos" ),
		os.path.join( WEBSITE_INPUT_DIRECTORY, "_media", "music" ),
		os.path.join( WEBSITE_INPUT_DIRECTORY, "_media", "downloads" ),
		os.path.join( WEBSITE_OUTPUT_DIRECTORY ),
		os.path.join( MODULES_DIRECTORY ),
		os.path.join( TEMPLATES_DIRECTORY ),
		os.path.join( WEBSITE_LOGS_DIRECTORY )
	),
	"files": (
		{
			"path": 		os.path.join( WEBSITE_INPUT_DIRECTORY, GLOBAL_CONFIG_FILE ),
			"content":		""
		},
		{
			"path": 		os.path.join( WEBSITE_INPUT_DIRECTORY, "_css", "basic.css" ),
			"content":		""
		},
		{
			"path": 		os.path.join( WEBSITE_INPUT_DIRECTORY, "_js", "basic.js" ),
			"content":		""
		},
		{
			"path": 		os.path.join( TEMPLATES_DIRECTORY, "basic.template" ),
			"content":		""
		},
		{
			"path": 		os.path.join( MODULES_DIRECTORY, "__init__.py" ),
			"content":		""
		},
		{
			"path": 		os.path.join( MODULES_DIRECTORY, "mod_main_nav.py" ),
			"content":		""
		},
		{
			"path": 		os.path.join( MODULES_DIRECTORY, "mod_sub_nav.py" ),
			"content":		""
		},
		{
			"path": 		os.path.join( WEBSITE_INPUT_DIRECTORY, GLOBAL_CONFIG_FILE ),
			"content":		""
		},
		{
			"path": 		os.path.join( WEBSITE_INPUT_DIRECTORY, "0_home", "0_index.txt" ),
			"content":		""
		},
		{
			"path": 		os.path.join( WEBSITE_INPUT_DIRECTORY, "1_about", "0_index.txt" ),
			"content":		""
		},
		{
			"path": 		os.path.join( WEBSITE_INPUT_DIRECTORY, "2_jungle", "0_index.txt" ),
			"content":		""
		},
		{
			"path": 		os.path.join( WEBSITE_INPUT_DIRECTORY, "2_jungle", "1_1st_definition_of_jungle.txt" ),
			"content":		""
		},
		{
			"path": 		os.path.join( WEBSITE_INPUT_DIRECTORY, "2_jungle", "2_2nd_definition_of_jungle.txt" ),
			"content":		""
		},
		{
			"path": 		os.path.join( WEBSITE_INPUT_DIRECTORY, "2_jungle", "3_3rd_definition_of_jungle.txt" ),
			"content":		""
		},
		{
			"path": 		os.path.join( WEBSITE_INPUT_DIRECTORY, "2_jungle", LOCAL_CONFIG_FILE ),
			"content":		""
		},		
		{
			"path": 		os.path.join( WEBSITE_INPUT_DIRECTORY, "3_gallery", "0_index.txt" ),
			"content":		""
		},
		{
			"path": 		os.path.join( WEBSITE_INPUT_DIRECTORY, "4_links", "0_index.txt" ),
			"content":		""
		},
		{
			"path":			STINGINGNETTLEPY_CONFIG_FILE,
			"content":		""
		}
	)
}

# 'Stingingnettlepy' required directories and files.
STINGINGNETTLEPY_PROJECT_WEBSITE_DIRECTORY_REQUIRED_DIRS_AND_FILES = {
	"directories": (
		os.path.join( WEBSITE_INPUT_DIRECTORY ),
		os.path.join( MODULES_DIRECTORY ),
		os.path.join( TEMPLATES_DIRECTORY )
	),
	"files": (
		os.path.join( TEMPLATES_DIRECTORY, "basic.template" ),
		os.path.join( MODULES_DIRECTORY, "__init__.py" ),
		os.path.join( WEBSITE_INPUT_DIRECTORY, GLOBAL_CONFIG_FILE )	
	)
}
